package org.nf.ssm.service.impl;

import com.github.pagehelper.PageInfo;
import lombok.RequiredArgsConstructor;
import org.nf.ssm.dao.BookTypeDao;
import org.nf.ssm.domain.BookType;
import org.nf.ssm.service.BookTypeService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author zhu
 * @date 2024-10-16
 */
@Service("bookTypeService")
@RequiredArgsConstructor
public class BookTypeServiceImpl implements BookTypeService {

    private final BookTypeDao bookTypeDao;

    @Override
    public PageInfo<BookType> getAllBookType(Integer pageNum, Integer pageSize) {
        List<BookType> bookTypeList = bookTypeDao.getAllBookType(pageNum, pageSize);
        return new PageInfo<>(bookTypeList);
    }

    @Override
    public List<BookType> getAllBookType() {
        return bookTypeDao.getAllBookType();
    }

    @Override
    public void addBookType(BookType bookType) {
        bookTypeDao.addBookType(bookType);
    }

    @Override
    public void updateBookType(BookType bookType) {
        bookTypeDao.updateBookType(bookType);
    }

    @Override
    public void deleteBookType(Integer typeId) {
        bookTypeDao.deleteBookType(typeId);
    }
}
